#include<iostream>  
#include<cstring>
using namespace std;
int main()
{
	string s1,s2;
	int a[1001],b[1001],len;
	int i,t,n=0;
	memset(a,0,sizeof(a));  
	memset(b,0,sizeof(b));
		cin>>s1>>s2;
		
	a[0]=s1.length();
	for(i=1;i<=a[0];i++)
    a[i]=s1[a[0]-1]-'0';
    
	b[0]=s2.length();
	for(i=1;i<=b[0];i++)
    b[i]=s2[b[0]-1]-'0';
    
    len=(a[0]>b[0]?a[0]:b[0]);
    for(i=1;i<=len;i++)
    {
    	a[i]+=b[i];
    	t=a[i]/10;
    	a[i]%=10;
    	a[i+1]+=t;
	}
	printf("%d%d\n",len,t);
	for(i=len;i>=1;i--)  
    cout<<a[i];
    return 0;
}
